package com.jmlee.exception;

import com.jmlee.pojo.ErrorCode;

/**
 * @Description 自定义API异常
 * @Author jmLee
 * @Date 2021/2/23 22:38
 * @Version 1.0
 */
public class ApiException extends RuntimeException {

    private ErrorCode errorCode;

    public ApiException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }
}
